package cn.kevinking.ai.mcp.provider.model;

import cn.kevinking.ai.mcp.provider.model.tool.McpDictParamConverter;
import cn.kevinking.ai.mcp.provider.annotation.McpToolParam;
import lombok.Builder;
import lombok.Data;

/**
 * @author jinkw
 */
@Data
@Builder
public class NativeToolParameterDefinition {
    private String type;
    private String description;
    private Class<? extends McpDictParamConverter> dictConverterClazz;
    private boolean required;

    public static NativeToolParameterDefinition fromToolParamAnnotation(McpToolParam toolParam, String type) {
        return NativeToolParameterDefinition.builder()
                .type(type)
                .description(toolParam.description())
                .dictConverterClazz(toolParam.converter())
                .required(toolParam.required())
                .build();
    }
}
